/*
 * @Author: wangming
 * @Date: 2021-03-26 10:45:02
 * @LastEditors: wangming
 * @LastEditTime: 2022-03-30 16:23:25
 * @Description: file content
 */
import Vue from "vue";
// import Element from 'element-ui'
// import '@/assets/sass/theme/common/var.scss'
import App from "./App.vue";
import router from "./router";
import store from "./store";
import DatePicker from "vue2-datepicker";
import "vue2-datepicker/locale/zh-cn";
import vueProto from "@/utils/vueProto.js";
import PermUtil from "@/utils/PermUtil.js";
import "./assets/sass/index.scss";
import "normalize.css/normalize.css";
import components from "./components/index.js";
import stores from "store2";
import VueCurrencyFilter from "vue-currency-filter";
import "./utils/filter"; // global filter
import "./utils/auth";
import "./components/BlocklyEditor/microApp";
import Mos from "./utils/mos";
import i18n, { CliI18n } from "./i18n";
import ThemeUtil from "./theme";

Window.prototype.$stores = stores;
var moment = require("moment");
moment.locale("zh-cn");
Vue.use(DatePicker);
Vue.use(components);
Vue.use(vueProto);
PermUtil.init();
Vue.config.productionTip = false;
Vue.use(VueCurrencyFilter, {
  thousandsSeparator: ",",
  fractionCount: 2,
  fractionSeparator: ".",
});
// 内部预览环境下不翻译
Vue.prototype.$at = (key) => {
  if (process.env.VUE_APP_USER === "ADMIN") return;
  return i18n.t(key);
};

Vue.config.ignoredElements = [
  "field",
  "block",
  "category",
  "xml",
  "mutation",
  "value",
  "sep",
];
const run = async () => {
  await Mos.init();
  ThemeUtil.init();
  await CliI18n.i18nInit();
  new Vue({
    router,
    store,
    i18n,
    render: (h) => h(App),
  }).$mount("#app");
};
run();
